{extend name="template/base" /}
{block name="style"}
<style>
.ncsc-goods-sku.ps-container {
    background-color: #FCFCFC;
    text-align: left;
    padding-bottom: 3px;
    border: solid 1px #E6E6E6;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 2px 2px 0 rgba(204,204,204,0.1);
	overflow-x:scroll
}
.ncsc-goods-sku-list {
    font-size: 0;
    white-space: nowrap;
    display: inline-block;
    margin: 10px 0;
    zoom: 1;
    overflow: hidden;
}
.ncsc-goods-sku-list li {
    font-size: 12px;
    vertical-align: top;
    letter-spacing: normal;
    word-spacing: normal;
    display: inline-block;
    width: 100px;
    padding: 0 9px 0 10px;
    margin-left: -1px;
    border-left: dashed 1px #E6E6E6;
}
.ncsc-goods-sku-list .goods-thumb {
    background-color: #FFF;
    width: 60px;
    height: 60px;
    padding: 1px;
    border: solid 1px #E6E6E6;
    margin: 0 auto 5px auto;
}
.ncsc-goods-sku-list .goods-thumb a {
    line-height: 0;
    text-align: center;
    vertical-align: middle;
    display: table-cell;
    width: 60px;
    height: 60px;
    overflow: hidden;
}
.ncsc-goods-sku-list .goods-thumb a img {
    max-width: 60px;
    max-height: 60px;
    margin-top: expression(60-this.height/2);
}
.ncsc-goods-sku-list .goods_spec{
    overflow:hidden
}
.ncsc-goods-sku-list .goods_spec em {
    color: #448944;
}
.ncsc-goods-sku-list .goods-price em {
    color: #F30;
}
.ncsc-goods-sku-list .goods-storage em {
    color: #27A9E3;
}
.ncsc-goods-sku-list .goods_spec em, .ncsc-goods-sku-list .goods-price em, .ncsc-goods-sku-list .goods-storage em {
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    display: inline-block;
    width: 60px;
    zoom: 1;
    overflow: hidden;
}
.ncsc-goods-sku-list a:hover.ncsc-btn-mini {
    text-decoration: none;
    color: #333;
    background-color: #E6E6E6;
    border-color: #CFCFCF #CFCFCF #B3B3B3 #CFCFCF;
}
.ncsc-goods-sku-list a.ncsc-btn-mini {
    font: normal 12px/20px arial;
    color: #777;
    background-color: #F5F5F5;
    text-align: center;
    vertical-align: middle;
    display: inline-block;
    height: 20px;
    padding: 0 10px;
    margin-right: 2px;
    border-style: solid;
    border-width: 1px;
    border-color: #DCDCDC #DCDCDC #B3B3B3 #DCDCDC;
    cursor: pointer;
}
.ncsc-brand-select {
    display:inline-block;
    position: relative;
    z-index: 1;
}
.ncsc-brand-select:hover .ncsc-brand-select-container {
    display: block;
}
.ncsc-brand-select-container {
    background: #FFF;
    display: none;
    width: 240px;
    border: solid 1px #CCC;
    position: absolute;
    z-index: 1;
    top: 25px;
    left: 0;
}
.ncsc-brand-select-container .brand-index {
    width: 210px;
    padding-bottom: 10px;
    margin: 6px auto;
    border-bottom: dotted 1px #CCC;
}
.ncsc-brand-select-container .letter ul {
    overflow: hidden;
}
.ncsc-brand-select-container .letter ul li {
    float: left;
}
.ncsc-brand-select-container .letter ul li a {
    line-height: 16px;
    color: #666;
    text-align: center;
    display: block;
    min-width: 16px;
    padding: 2px;
    margin: 0;
}
a {
    blr: expression(this.onFocus=this.blur());
}
.ncsc-brand-select-container .search {
    line-height: normal;
    clear: both;
    margin-top: 6px;
}
.ncsc-brand-select-container .search .ncsc-btn-mini {
    vertical-align: top;
    margin-left: 4px;
}
.ncsc-brand-select-container .brand-list {
    width: 220px;
    max-height: 220px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    overflow-y:scroll;
}
.ncsc-brand-select-container .brand-list ul li:hover {
    color: #333;
    background: #F7F7F7;
    cursor: pointer;
}
.ncsc-brand-select-container .brand-list ul li {
    line-height: 20px;
    padding: 5px 0;
    border-bottom: solid 1px #F5F5F5;
}

.ncsc-brand-select-container .brand-list ul li em {
    display: inline-block;
    text-align: center;
    width: 20px;
    margin-right: 6px;
    border-right: solid 1px #DDD;
}
.ncsc-brand-select-container .no-result {
    color: #999;
    text-align: center;
    padding: 20px 10px;
}
.ncsc-brand-select-container .no-result strong {
    color: #27A9E3;
}
</style>
{/block}
{block name="content"}
<div class="page-container ">
    <div class="mb-10 c-primary">
        <h5 class=""><strong><i class="icon Hui-iconfont">&#xe6cd;</i>操作提示</strong></h5>
    <ul class='c-999'>
        <li><span class="pipe">|</span>上架，当商品处于非上架状态时，前台将不能浏览该商品，店主可控制商品上架状态</li>
        <li><span class="pipe">|</span>违规下架，当商品处于违规下架状态时，前台将不能购买该商品，只有管理员可控制商品违规下架状态，并且商品只有重新编辑后才能上架</li>
        <li><span class="pipe">|</span>违规下架，当商品处于违规下架状态时，前台将不能购买该商品，只有管理员可控制商品违规下</li>
        <li><span class="pipe">|</span>违规下架，当商品处于违规下品违规下架状态，并且商品只有重新编辑后才能上架</li>
    </ul>
    </div>
    {include file='goods/goods_common/form' /}
    <div class="cl pd-5 bg-1 bk-gray">
    	<span class="l">
            {tp:menu menu='resume,recyclebin,delete'/}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="goods/goods_common/th" /}
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="goods/goods_common/td" /}
            <td class="f-14">
            {if($is_verify)}
            	{if($vo.goods_verify==GOODS_VERIFY_WAIT)}
                    {tp:access action="audit"}
                    <a href="javascript:;" class="label label-success radius" onclick="layer_open('审核状态', '{:\\think\\Url::build(\'audit\',[\'id\'=>$vo.id])}')">审核</a>
                    {/tp:access}
            	{/if}
            {/if}
                    <a href="{:url('index/goods/detail',['goods_id'=>$goodsid_list[$vo.id]['id']])}" target="_blank" class="label label-primary radius">查看</a>
            	{if($vo.goods_verify==GOODS_VERIFY_FAIL || ($vo.goods_verify==GOODS_VERIFY_PASS && $vo.goods_state==GOODS_STATE_OUT)
            		|| ($vo.goods_verify==GOODS_VERIFY_PASS && $vo.goods_state==GOODS_STATE_OUT_LINE))}
                	{tp:menu menu='sdelete' /}
            	{/if}
                
            	{if ($vo.goods_verify==GOODS_VERIFY_PASS && $vo.goods_state==GOODS_STATE_ON)}
                    {tp:access action="off_sale"}
            		<a href="javascript:;" class="label label-warning radius" onclick="layer_open('违规下架理由', '{:\\think\\Url::build(\'off_sale\',[\'id\'=>$vo.id])}')">违规下架</a>
                     {/tp:access}   
                {/if}
            </td>
        </tr>
        <tr style="display:none;background: rgb(255, 255, 255);">
          <td colspan="10">
          	<div class="ncsc-goods-sku ps-container" style="width: 1650px;">
          	</div>
          </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$list->render()}</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="/old/data/resource/js/admincp.js"></script>
<script type="text/javascript" src="/old/data/resource/js/common_select.js"></script>
<script type="text/javascript">
$(function(){
	$('.show-plus').click(function(){
        _self = this;
		url = "goods_list";
		id = $(this).attr("data-id");
		data = {id:id};
	    var _parenttr = $(this).parents('tr');
	    var _div = _parenttr.next().find('.ncsc-goods-sku');
	    if($(_div).find('ul.ncsc-goods-sku-list').length>0){
	    	_parenttr.next().show();
            $(_self).hide();
            $(_self).parent().find('.show-minus').show();
	    	return;
	    }
	    $.get(url, data, function (result) {
	        if (result.code == 0) {
	        	var _ul = $('<ul class="ncsc-goods-sku-list"></ul>');
	            $.each(result.data, function(i, o){
	                $('<li><div class="goods-thumb" title="商家货号：' + o.goods_serial + '"><a href="' + o.url + '" target="_blank"><image src="' + o.goods_image + '" ></a></div>' + o.goods_spec + '<div class="goods-price">价格：<em title="￥' + o.goods_price + '">￥' + o.goods_price + '</em></div><div class="goods-storage">库存：<em title="' + o.goods_storage + '">' + o.goods_storage + '</em></div><a href="' + o.url + '" target="_blank" class="ncsc-btn-mini">查看商品详情</a></li>').appendTo(_ul);
	                });
	            _ul.appendTo(_div);
	            $(_self).hide();
	            $(_self).parent().find('.show-minus').show();
	            _parenttr.next().show();
	        } else {
	            layer.alert(result.msg);
	        }
	    }, 'json');
	});
	
	$('.show-minus').click(function(){
		$(this).parents('tr').next().hide();
        $(this).hide();
        $(this).parent().find('.show-plus').show();
	});
        
    /* AJAX选择品牌 */
    $("#ajax_brand").brandinit();

});
</script>
{/block}